package com.team7.happycommunity.parkservice.controller;

import com.team7.happycommunity.parkservice.common.CommonResult;
import com.team7.happycommunity.parkservice.pojo.AreaInfo;
import com.team7.happycommunity.parkservice.service.AreaInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/area")
public class AreaController {

    @Autowired
    AreaInfoService areaInfoService;

    @GetMapping("/getall")
    @ResponseBody
    public CommonResult getAll(){
        List<AreaInfo> list_areainfo = areaInfoService.selectAll();
        return CommonResult.success(list_areainfo);
    }
}
